﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

public class SceneDisplayObject:System.Object
{
    //显示
    private SceneAvatarBase _display;

    public SceneAvatarBase display
    {
        get
        {
            return _display;
        }
    }

    //数据
    private SceneDisplayBaseVo _data;
    public SceneDisplayBaseVo data
    {
        get
        {
            return _data;
        }
    }

    public virtual void Init(SceneDisplayBaseVo val){
        _data = val;
        AvatarBaseVo vo = null;
        if (this is SceneHero)
        {
            vo = new HeroAvatarVo();
            vo.assetbundleName = data.assetbundleName;
            _display = new SceneHeroAvatar();
        }
        else if(this is ScenePlayer)
        {
            vo = new PlayerAvatarVo();
            vo.assetbundleName = data.assetbundleName;
            _display = new  ScenePlayerAvatar();
        }
        else if(this is SceneRunActor)
        {
            vo = new RunActorAvatarVo();
            vo.assetbundleName = data.assetbundleName;
            _display = new SceneRunActorAvatar();
        }
        else
        {
            vo = new AvatarBaseVo();
            vo.assetbundleName = data.assetbundleName;
            _display = new SceneAvatarBase();
        }
        _display.Init(vo);
    }

}
